<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
	<meta charset="UTF-8">
	<title>如是说是第一的说</title>
</head>
<body ng-app="mardd">

	<!-- 数据绑定-->
	<div ng-init="quantity=1;price=5">
		<h2>价格计算器</h2>
		数量： <input type="number"	ng-model="quantity">
		价格： <input type="number" ng-model="price">
		<p><b>总价：</b> {{ quantity * price }}</p>
	</div>

	<!-- 重复Html元素-->
	<div ng-init="names=['jade','script','coffe']">
		<p>使用 ng-repeat 循环数组</p>
		<ul>
			<li ng-repeat="xdd in names">{{ xdd }}</li>
		</ul>
	</div>
	<div ng-init="namesd=[
												{name:'Jani',country:'Norway'},
												{name:'Hege',country:'Sweden'},
												{name:'Kai',country:'Denmark'}]">
		<p>循环对象：</p>
		<ul>
			<li ng-repeat="x in namesd">
				{{ x.name + ', ' + x.country }}
			</li>
		</ul>
	</div>

	<!-- 自定义指令，就问你怕不怕~~ -->
	<!--<runoob-directive></runoob-directive>-->
	<div runoob-directive></div>
	<!--<div class="runoob-directive"></div>-->
	<!-- directive: runoob-directive -->



	<script src="angular.min.js"></script>
	<script>
		var app = angular.module('mardd',[]);
		app.controller('app',function(){});

		// 自定义指令
		app.directive("runoobDirective",function(){
			return {
				// restrict : "M",
				// http://www.runoob.com/angularjs/angularjs-directives.html
				template : "<h1>自定义的，就问你怕不怕~</h1>"
			}
		});
	</script>
</body>
</html>